package br.com.caiocarrara.goodbuy.model;

import br.com.caelum.vraptor.ioc.Component;
import br.com.caelum.vraptor.ioc.SessionScoped;

@Component
@SessionScoped
public class UserLogged {
	private User loggedUser;
	
	public void login(User user) {
		this.loggedUser = user;
	}
	
	public String getName() {
		return this.loggedUser.getName();
	}
	
	public boolean isLogged() {
		return loggedUser != null;
	}
	
	public void logout() {
		this.loggedUser = null;
	}
}

